
package Usefull;

import org.newdawn.slick.opengl.*;
import static org.lwjgl.opengl.GL11.*;

/**
 * SimpleOGLRenderer.java
 * Created on May 5, 2014
 * Author Joe Porter
 */
public class SimpleOGLRenderer {

    
        int screenX = 800,screenY = 600,
                fps = 60;
        String title = "Test";
        Texture test;
        public SimpleOGLRenderer(){
            Utils utilites = new Utils();
            
            utilites.CreateDisplay(screenX, screenY, title);
            utilites.InitOGL(screenX, screenY);
            test = utilites.loadTexture("PNG", "test");
            
            while(!utilites.display.isCloseRequested()){
                glClear(GL_COLOR_BUFFER_BIT);
                
                test.bind();
                
                glBegin(GL_QUADS);
                    glTexCoord2f(0, 0);
                    glVertex2f(400, 400);
                    glTexCoord2f(1, 0);
                    glVertex2f(450, 400);
                    glTexCoord2f(1, 1);
                    glVertex2f(450, 450);
                    glTexCoord2f(0, 1);
                    glVertex2f(400, 450);
                glEnd();
                
                utilites.display.update();
                utilites.display.sync(fps);
                
            }
            utilites.display.destroy();
        }
        
        public static void main(String[] Args){
            SimpleOGLRenderer simple = new SimpleOGLRenderer();
        }
}
